import { AccountEntity } from './../../../account/entities/account.entity';
import { LoginService } from '../../services/login/login.service';
import { Resolver, Args, Query } from '@nestjs/graphql';
import { LoginInput } from './dto/login.input';
import { JwtService } from '@nestjs/jwt';

@Resolver()
export class LoginResolver {
    constructor(
        private readonly loginService:LoginService,
    ) {}

    @Query(type => AccountEntity!, {nullable: false, description: '登录'})
    async login(
        @Args('data') loginInput: LoginInput,
    ):Promise<AccountEntity> {
        return await this.loginService.login(loginInput);
    }
}
